package com.mew.chess.core.game.shbz.game.common;

import com.alibaba.fastjson.JSON;
import com.mew.chess.core.game.shbz.game.ShbzGameManager;
import com.mew.common.util.TxtUtils;
import lombok.Data;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

@Data
@ToString
public class Route {

    public int lineID;
    public int rootLength;
    public int[] fishType;
    public int boss;
    public String[] pointsSpeed;

    private static String path = "external/roller/fish/FishLine.json";


    public static void initRoutes(ShbzGameManager gameManager){
        List<Route> routeList = new ArrayList<>();
        List<Route> routeBoss = new ArrayList<>();

        String json = TxtUtils.byFile(path);
        Route[] routes = JSON.parseObject(json, Route[].class);
        for (Route route : routes) {
            if (route.boss==0){
                routeList.add(route);
            }else {
                routeBoss.add(route);
            }
        }
        gameManager.setFishRoute(routeList);
        gameManager.setFishBossRoute(routeBoss);

    }

    public static void main(String[] args) {

    }

}
